• A Directions object provides you with optimal directions between different locations, or waypoints. The directions object passes your request to the Mapbox Directions API and returns the requested information to a closure (block) that you provide. A directions object can handle multiple simultaneous requests. A RouteOptions object specifies criteria for the results, such as intermediate waypoints, a mode of transportation, or the level of detail to be returned.

    Each result produced by the directions object is stored in a Route object. Depending on the RouteOptions object you provide, each route may include detailed information suitable for turn-by-turn directions, or it may include only high-level information such as the distance, estimated travel time, and name of each leg of the trip. The waypoints that form the request may be conflated with nearby locations, as appropriate; the resulting waypoints are provided to the closure.

    See more

    Declaration

    Swift

    open class Directions : NSObject
    extension Directions: OfflineDirectionsProtocol
  • A RouteOptions object is a structure that specifies the criteria for results returned by the Mapbox Directions API.

    Pass an instance of this class into the Directions.calculate(_:completionHandler:) method.

    See more

    Declaration

    Swift

    open class RouteOptions : DirectionsOptions
  • A Waypoint object indicates a location along a route. It may be the route’s origin or destination, or it may be another location that the route visits. A waypoint object indicates the location’s geographic location along with other optional information, such as a name or the user’s direction approaching the waypoint. You create a RouteOptions object using waypoint objects and also receive waypoint objects in the completion handler of the Directions.calculate(_:completionHandler:) method.

    See more

    Declaration

    Swift

    public class Waypoint : Codable
    extension Waypoint: Equatable
    extension Waypoint: CustomStringConvertible